<template>
  <el-menu
    :style="{width: !isCollapse ?'230px': '64px'}"
    active-text-color="#ffd04b"
    background-color="#545c64"
    class="aisde-container"
    text-color="#fff"
    @open="handleOpen"
    @close="handleClose"
    :collapse="isCollapse"
    :default-active="active"
  >
      <p class="logo">{{ isCollapse ? 'DIDI' : 'DIDI陪诊' }}</p>
      <!-- 菜单内容 -->
        <TreeMeue :index="1" :meunDate="meunDate" />
      </el-menu>
</template>

<script setup>
import TreeMeue from './treeMenu.vue'
import { useRouter} from 'vue-router'
import { reactive,computed } from 'vue'
import { useStore} from 'vuex'

const  store = useStore()
const isCollapse = computed(()=>{
  return store.state.menu.isCollapse
})

const router = useRouter()
// 获取路由菜单数据-固定式
// const meunDate = reactive(router.options.routes[0].children)
const meunDate = computed(()=> store.state.menu.routerList)
console.log('meunDate:',meunDate)
const handleOpen = ()=>{}
const  handleClose = ()=>{}

// 处理菜单选择
const active = computed(()=>store.state.menu.menuActive)
</script>

<style scoped lang="less">
.aisde-container{
  height: 100%;
  .logo{
    font-size: 20px;
    text-align: center;
    height: 50px;
    line-height: 50px;
    color: white;
  }
}

</style>